#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QProcess>
#include <QX11EmbedContainer>
#include <QTimer>
#include <QDateTime>
#include <QDir>
#include <QDataStream>
#include <QIODevice>
#include <QDebug>
#include <QImageWriter>

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    bool startRecording();

    void setImageFormat(QString format) { m_imageFormat = format; }
    void setResolution(QString resolution) { m_resolution = resolution; }
    void setKeyLayout(QString keylayout) { m_keylayout = keylayout; }
    void setServerName(QString servername) { m_serverName = servername; }

protected slots:
    void capture();

private:
    Ui::MainWindow *ui;
    QX11EmbedContainer* m_container;
    QProcess *m_process;
    QTimer* m_timer;
    QFile* m_file;
    QImageWriter* m_imageWriter;
    QString m_imageFormat;
    QString m_resolution;
    QString m_keylayout;
    QString m_serverName;
};

#endif // MAINWINDOW_H
